package com.ruge.spring.cloud.gateway.base.token;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 嘿丷如歌
 * @version V1.0
 * @Description: Token
 * @date 2021/4/26 21:47
 */
public class Token implements Serializable {
    private static final long serialVersionUID = -6602465878134234541L;
    protected String uid;
    protected String aid;
    protected String clientId;
    protected ClientType clientType;
    protected long createdTime;
    protected String cipherString;
    protected String originalToken;

    public Token() {
    }

    public Token(String uid, String aid, String clientId, ClientType clientType) {
        this.uid = uid;
        this.aid = aid;
        this.clientId = clientId;
        this.clientType = clientType;
        this.createdTime = (new Date()).getTime();
    }

    public Token(String uid, String aid, String clientId, ClientType clientType, String cipherString) {
        this.uid = uid;
        this.aid = aid;
        this.clientId = clientId;
        this.clientType = clientType;
        this.createdTime = (new Date()).getTime();
        this.cipherString = cipherString;
    }

    public String getAid() {
        return this.aid;
    }

    public String getUid() {
        return this.uid;
    }

    public String getClientId() {
        return this.clientId;
    }

    public ClientType getClientType() {
        return this.clientType;
    }

    public long getCreatedTime() {
        return this.createdTime;
    }

    public String toCipherString() {
        return this.cipherString;
    }

    public String getCipherString() {
        return cipherString;
    }

    public void setCipherString(String cipherString) {
        this.cipherString = cipherString;
    }

    public String getOriginalToken() {
        return originalToken;
    }

    public void setOriginalToken(String originalToken) {
        this.originalToken = originalToken;
    }

    @Override
    public String toString() {
        return "Token{" +
                "uid='" + uid + '\'' +
                ", aid='" + aid + '\'' +
                ", clientId='" + clientId + '\'' +
                ", clientType=" + clientType +
                ", createdTime=" + createdTime +
                ", cipherString='" + cipherString + '\'' +
                ", originalToken='" + originalToken + '\'' +
                '}';
    }
}